<template>
	<view>
		<view v-for="(item, id) in list" :key="id">{{ item.name }}</view>
		<!-- 添加 -->
		<button type="default" @tap="add">添加</button>
		<view>{{token}}</view>
	</view>
</template>
<script>
import { mapActions, mapState } from 'vuex';
import { toast } from '@/utils/toast';
import request from '@/utils/request';

export default {
	data() {
		return {
			list: [{ name: '我' }, { name: '我是' }],
			time:"2020.2553",
			token:""
		};
	},
	methods: {
		add() {
			this.list.push({name:this.time})
            console.log(this.list,88)
			uni.setStorage({
			    key: 'storage_key',
			    data: this.list,
			    success: function () {
			        console.log('success');
			    }
			});
			this.token = uni.getStorageSync('storage_key')
		}
	}
};
</script>
<style lang="scss" scoped></style>
